Update to Go 1.20 and React with line numbers#80
Update to Go 1.20 and React with line numbers#80grantnelson-wf wants to merge 3 commits intogopherjs:masterfrom
Conversation
b12aa11 to
0d589cf
Compare
8e30f05 to
070e595
Compare
467c2db to
d2fc561
Compare
378a7c1 to
e9dfcbe
Compare
d3dadca to
ce7116a
Compare
nevkontakte
left a comment
There was a problem hiding this comment.
I'll be honest and admit that I gave a cursory look to most of the code here.
Personally, I feel like React is a bit of an overkill for what Playground is, but it's an iprovement over the status quo, and if nothing else a pretty useful tech demo, so I have no real objection.
Thanks!
| } | ||
|
|
||
| // Run load synchronously to await for the package to be available. | ||
| srcs, _, err := r.cache.Load(path) |
There was a problem hiding this comment.
nit: Shadowing here makes recursion a bit more confusing than necessary.
There was a problem hiding this comment.
I wasn't quite sure how to make that work so that we didn't send multiple network requests but could block on multiple asks for the same import. Although, just now, thinking about it, the browser itself typically has a debounce for multiple network requests of the same thing. So this probably can be simplified, I just hadn't thought of using the browser's network tools to see if I could simplify it. (Problem with tinkering on this on the side, I sometimes got something working and didn't leave TODOs nor remember to go back and make it work better.)
Yeah, React is a little overkill. This totally was totally a tech demo (I wanted it in as much Go as possible) and a learning tool for me to try out things I haven't done much of before, and I probably went overboard since I was having fun. I tinkered on this project on the side for several months while waiting for some CI to finish, between meetings, and even during very slow boring meetings. It has lots of room for improvement and I hope many people add to it. Note: I did find one bug but haven't gotten back around to fix it. If you have no imports the compiler doesn't automatically add runtime so it fails to compile. Should be an easy fix. |
I'm doing a lot of experimentation and improvements to the GopherJS playground.